<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>调整背景图片大小</title>
  <style>
    .box {
      width: 200px;
      border: 2px solid red;
    }
    img {
      width:200px
    }
    .cover {
      object-fit: cover;
    }
    .contain {
      object-fit: contain;
    }
  </style>
</head>
<body>
<div class="wrapper">
  <div class="box"><img src="img/balloons.jpg" alt="balloons" class="cover"></div>
  <div class="box"><img src="img/balloons.jpg" alt="balloons" class="contain"></div>

</div>
</body>
</html>